package com.retain.system.vo;

import com.retain.system.dto.RoleDTO;
import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;

/**
 * @author: LiuWei
 * @date: Create in 16:23 2018/12/27
 */
@Data
@NoArgsConstructor
@AllArgsConstructor
public class RoleVO {

    private Long id;

    private String roleName;

    private String code;

    public static final RoleVO buildRoleVO(final RoleDTO roleDTO) {
        if (roleDTO != null) {
            RoleVO roleVO = new RoleVO();
            roleVO.setCode(roleDTO.getCode());
            roleVO.setId(roleDTO.getId());
            roleVO.setRoleName(roleDTO.getRoleName());
            return roleVO;
        }
        return null;
    }
}
